package com.paris10.thread;

import java.util.ArrayList;
import java.util.List;

import com.paris10.model.AbstractSource;
import com.paris10.model.Article;

public class RechercheThread extends Thread {
	private AbstractSource source;
	private String[] mots;
	private List<Article> listeArticle;
	
	public RechercheThread(AbstractSource source, String[] mots){
		this.source = source;
		this.mots = mots;
		listeArticle = new ArrayList<Article>();
	}
	
	public List<Article> getListArticle(){
		return this.listeArticle;
	}
	
	public void run(){

		for(Article article : source.rechercherMotsCles(mots)){
			listeArticle.add(article);
		}
	}
}
